﻿using AspNetCore.Practice.Domain.Entities;
using SD.Common.PoweredByLee;
using SD.IdentitySystem.IAppService.DTOs.Outputs;

namespace AspNetCore.Practice.AppService.Maps
{
    /// <summary>
    /// 授权映射
    /// </summary>
    public static class AuthorizationMap
    {
        #region # 信息系统映射 —— static InfoSystemInfo ToDTO(this InfoSystem infoSystem)
        /// <summary>
        /// 信息系统映射
        /// </summary>
        /// <param name="infoSystem">信息系统领域模型</param>
        /// <returns>信息系统数据传输对象</returns>
        public static InfoSystemInfo ToDTO(this InfoSystem infoSystem)
        {
            InfoSystemInfo systemInfo = infoSystem.Map<InfoSystem, InfoSystemInfo>();

            return systemInfo;
        }
        #endregion

        #region # 用户映射 —— static UserInfo ToDTO(this User user)
        /// <summary>
        /// 用户映射
        /// </summary>
        /// <param name="user">用户领域模型</param>
        /// <returns>用户数据传输对象</returns>
        public static UserInfo ToDTO(this User user)
        {
            UserInfo userInfo = user.Map<User, UserInfo>();

            return userInfo;
        }
        #endregion
    }
}
